package net.jiastudy.biz.targettask.entity;

import net.jiastudy.biz.enums.AuditStatus;
import net.jiastudy.biz.enums.TargetTaskLevel;
import net.jiastudy.biz.sys.entity.Dept;
import net.jiastudy.core.base.BaseEntity;

import java.util.List;

import io.swagger.annotations.ApiModelProperty;

public class TargetTaskTree extends BaseEntity<TargetTaskTree> {
    private Long id;
    private String title;
    private String origin;
    private Long originatedDeptId;
    private Long year;
    private AuditStatus status;
    private Long receiveDeptId;
    private TargetTaskLevel level;
    private Long parentId;
    private Dept receiveDept;
    private Boolean isMyDept;
    private Boolean isMyAudit;
    private String levelName;

    public String getLevelName() {
        return levelName;
    }

    public void setLevelName(String levelName) {
        this.levelName = levelName;
    }

    private String receiveDeptName;

    private List<TargetTaskTree> children;

    @Override
    public Long getId() {
        return id;
    }

    @Override
    public void setId(Long id) {
        this.id = id;
    }

    public Boolean getMyDept() {
        return isMyDept;
    }

    public void setMyDept(Boolean myDept) {
        isMyDept = myDept;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getOrigin() {
        return origin;
    }

    public void setOrigin(String origin) {
        this.origin = origin;
    }

    public Long getOriginatedDeptId() {
        return originatedDeptId;
    }

    public void setOriginatedDeptId(Long originatedDeptId) {
        this.originatedDeptId = originatedDeptId;
    }

    public TargetTaskLevel getLevel() {
        return level;
    }

    public void setLevel(TargetTaskLevel level) {
        this.level = level;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public List<TargetTaskTree> getChildren() {
        return children;
    }

    public Long getReceiveDeptId() {
        return receiveDeptId;
    }

    public void setReceiveDeptId(Long receiveDeptId) {
        this.receiveDeptId = receiveDeptId;
    }

    public void setChildren(List<TargetTaskTree> children) {
        this.children = children;
    }

    public Long getYear() {
        return year;
    }

    public void setYear(Long year) {
        this.year = year;
    }

    public String getType() {
        return "task";
    }

    public AuditStatus getStatus() {
        return status;
    }

    public void setStatus(AuditStatus status) {
        this.status = status;
    }

    public String getReceiveDeptName() {
        return receiveDeptName;
    }

    public void setReceiveDeptName(String receiveDeptName) {
        this.receiveDeptName = receiveDeptName;
    }

    public String getLevelDesc() {
        return level.getDesc();
    }
    public String getLevelDesc1() {
        if (level.getValue().equals(0)) {
            return "标题";
        } else if (level.getValue().equals(1)) {
            return "党政要点";
        } else if (level.getValue().equals(3)) {
            return "二级";
        } else if (level.getValue().equals(2)) {
            return "一级";
        }

        return null;
    }

    public Boolean getMyAudit() {
        return isMyAudit;
    }

    public void setMyAudit(Boolean myAudit) {
        isMyAudit = myAudit;
    }
}
